home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / io3.doc < prev    next >
Text File  |  1995-03-31  |  9KB  |  178 lines

  1. IO, 24 powerful (and dangerous) system-level routines by various authors. 
  2.         Documentation by Joe Horn. 
  3.  
  4.         Most of these programs can easily cause a Memory Clear if not used 
  5.         carefully.  Follow these instructions closely, and be sure to backup 
  6.         your memory before experimenting with these tools. 
  7.  
  8.         Note: The term "meta-object" is used below with the same meaning as in 
  9.         Jim Donnelly's HP 48 ToolKit Manual.  A meta-object isn't really an 
  10.         object, but a collection of objects on the stack, plus a count. For 
  11.         example, if you type in { 9 8 7 }, that's just one normal object (a 
  12.         "list object").  But if you now do OBJ-> on it, you get 9 8 7 3 on the 
  13.         stack (using levels 1 through 4).  This is called a meta-object, with 
  14.         9 8 7 being its contents, and 3 being its count. 
  15.  
  16.         Other odd-sounding object types (like "System Binary", "External", 
  17.         "Code" and so on) are described in HP48SX.DOC in the DNICKEL directory 
  18.         on this disk. 
  19.  
  20. úÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ 
  21.  
  22. PRG->: Decomposes a program object into a meta-object on the stack. 
  23.         By Rick Grevelle. 
  24.           Input: program object. 
  25.           Example: << 1 2 + >> PRG->  -->  << 1 2 + >> 5 (split up on stack). 
  26.           Note: PRG-> and ->PRG can be used to edit non-editable programs. 
  27.         Combined with HEX-> and ->HEX, any possible program can be written and 
  28.         edited. Also, internal functions can be explored like this: { + } 
  29.         OBJ-> DROP PRG->.  You'll see the "+" program on the stack!  (Use 
  30.         ->HEX to find out what each "External" object is.) 
  31.  
  32. ->PRG: Converts a meta-object on the stack into a single program object. 
  33.         By Rick Grevelle. 
  34.           Input: Any number (n) of objects on the stack, with n on level 1. 
  35.           Note: The user-program delimiters << and >> are NOT appended. 
  36.           Example: { 1 2 + } OBJ-> ->PRG  -->  1 2 + (all on level 1.  Try 
  37.         EVAL). 
  38.  
  39. ->HEX: Converts object to a string of hex digits (poor man's disassembler). 
  40.         By Rick Grevelle. 
  41.           Example: { + }  ->HEX  -->  "47A2076BA1B2130". 
  42.           Note: ->HEX produces only hex digits; no line feeds or checksum. It 
  43.         may therefore be used to convert any object to the form used by the 
  44.         Voyager program by Derek Nickel. (Or use his BINTOMEM program.) 
  45.  
  46. HEX->: Converts string of hex digits to an object (poor man's assembler). 
  47.         By Rick Grevelle. 
  48.           Example: "47A2076BA1B2130"  HEX->  -->  { + }. 
  49.           Note: To engineer a user-created object, type its internal hex 
  50.         representation as one long string, and press HEX->.  Caution: objects 
  51.         with illegal contents can cause a Memory Clear. 
  52.  
  53. SYSRCL: Recalls system object at given address.  Arg = binary integer. 
  54.           Example: #1AB67h SYSRCL  -->   +. 
  55.  
  56. ADDR: Yields address of object in level 1. 
  57.           Example: { + } OBJ-> DROP ADDR yields #1AB67h (the address of +). 
  58.  
  59. ->ASC: Converts any object into hex + checksum. 
  60.         By Bill Wickes. 
  61.           Example: { + } ->ASC  -->  "47A2076BA1B2130248F". 
  62.           Note: ->ASC is like ->HEX above, except for two additional features: 
  63.         (1) Line feeds are added after every 64 characters, and (2) a 4-digit 
  64.         CRC checksum is tacked onto the end (248F in the example above). See 
  65.         Bill Wickes' file ASC.TXT in the DNICKEL directory on this disk. 
  66.  
  67. ASC->: Converts hex + checksum into original object. 
  68.         By Bill Wickes. 
  69.           Example: "47A2076BA1B2130248F"  ASC->  -->  { + }. 
  70.           Note: ASC-> is like HEX-> above, except that it expects line feeds 
  71.         after every 64th character, and it requires a correct checksum to be 
  72.         the final four digits. See Bill Wickes' file ASC.TXT in the DNICKEL 
  73.         directory on this disk. 
  74.  
  75. ->XLIB: Creates any specified XLIB object, from library & token numbers. 
  76.         By Rick Grevelle.  See XLIB.DOC for more information. 
  77.           Example: 268 12 ->XLIB  -->  XLIB 268 12 (if you don't have the Eq 
  78.         Library card plugged in;  --> ELVERSION if you do have it. Try 
  79.         EVAL.) ->XLIB easily creates library functions even when the library 
  80.         isn't in in memory or attached.  It also allows easy access to the 
  81.         internal Library 240 functions, which are bankswitched and must be 
  82.         XLIB'd. 
  83.  
  84. XLIB->: Inverse of ->XLIB.  See XLIB.DOC for more information. 
  85.         By Rick Grevelle. 
  86.           Example: After example above, press XLIB-> and see 268 12. 
  87.  
  88. X->R: XLIB-to-RPL converter.  Pulls an XLIB object out of its library. 
  89.         By Rick Grevelle. 
  90.           Input: Any XLIB word (for example, MINEHUNT or ELVERSION). 
  91.           Example: With the EQ Library Card installed, type { MINEHUNT } 1 GET 
  92.         X->R  -->  External XLIB 268 63.  This is the first level of the 
  93.         unthreading of the MINEHUNT game. 
  94.  
  95. R->X: RPL-to-XLIB reverter.  Reverts an X->R output to its original input. 
  96.         By Rick Grevelle. 
  97.           Example: After above example, press R->X and see MINEHUNT. 
  98.  
  99. ->SB: Converts to a system binary (also called a "short binary"). 
  100.           Argument: real number.  Example: 153 ->SB  -->  <99h>. 
  101.  
  102. SB->: Converts from a system binary. 
  103.           Argument: system binary.  Example:  <99h>  SB->  -->  153. 
  104.  
  105. ->RPN: Convert algebraic object into equivalent RPN object (list). 
  106.         By Joe Horn. 
  107.           Example: '1+2*3+4' ->RPN  -->  { 1 2 3 * + 4 + }.  (Try EVAL). 
  108.  
  109. RPN->: Convert RPN object (list) into equivalent algebraic object. 
  110.         By Joe Horn. 
  111.           Example: { 1 2 3 * + 4 + } RPN->  -->  '1+2*3+4'.  (Try EVAL). 
  112.           Caution: Converting non-well-formed "RPN objects" into algebraics 
  113.         will either result in an 'Invalid Expression' or 'UNKNOWN' on the 
  114.         stack, which will evaluate the same as the list before conversion; or 
  115.         in Memory Clear (in extreme cases).  For safety's sake, only use lists 
  116.         containing ->RPN outputs, or similar.  Things like { << 5 >> } are not 
  117.         meaningful and tempt fate. 
  118.  
  119. CD->C: Converts hex string to Code object. 
  120.           Example: "142164808C" CD->C  -->  Code  (a placebo object). 
  121.           Like A->H, but adds Code prolog & length automatically. 
  122.  
  123. REV: Reverses byte order of a string, very quickly. 
  124.         By Derek Nickel. 
  125.           Example: "This is a test" REV  -->  "tset a si sihT" 
  126.  
  127. STRIP: Strips the << and >> off the program in level 1. 
  128.         By Conrad Winchester. 
  129.           Argument: Program object with << and >> delimiters. 
  130.           Caution: STRIP does not check, it just runs, removing the second 
  131.         five and second-to-last five nibs of the object in level 1.  If you 
  132.         give it something other than a program, you may get a Memory Clear. 
  133.  
  134. PACK: Packs a program's SYSEVALs into "External" form. 
  135.         By Joe Horn. 
  136.           See PACK.DOC on this disk for complete explanation. 
  137.           This version uses ->HEX and HEX->, programs found in this IO 
  138.         directory. 
  139.  
  140. PEEK: Gives contents of memory at given address, BACKWARDS. 
  141.           Example: #0h PEEK  -->  # 8001FDAD801B9632h. 
  142.         This means that address #0 is 2, #1 is 3, #3 is 6, etc, backwards. 
  143.  
  144. POKE: Stores binary integer at given address.  VERY DANGEROUS! 
  145.           Example: 153 ADDR #0 POKE  -->  Memory Clear! 
  146.           Arguments: Address, # to poke there. 
  147.  
  148. FNXT: Find Next.  Searches ROM/RAM for any hex digits. 
  149.         By Dave Marsh. 
  150.           Input: #search, #start, any. 
  151.           Level 1 is DROPped and SYSRCLed when search terminates, which allows 
  152.         repeated pressing of FNXT.  Notice that the argument on level 3 is the 
  153.         binary number to look for, immediately followed by the number of 
  154.         digits to look for (minus 1!), which allows you to look for leading 
  155.         zeros.  (#1237 looks for the 8 digits 00000123.) 
  156.           Example: Code objects begin with #02DCCh.  That's 5 hex digits, so 
  157.         add the digit "4" (one less than 5) to it: #02DCC4h.  (Leading zeros 
  158.         do not need to be typed, of course).  To look for all the Code objects 
  159.         in the operating system (starting at address #0h), type: #2DCC4h  #0h  
  160.         #0h  FNXT.  Pressing FNXT again finds the next one, etc. 
  161.           FNXT uses FIND, a program "hidden" in this IO directory. 
  162.           Note: If you want speed and have a PC handy, don't use FNXT; use the 
  163.         SEARCH command in Derek Nickel's Voyager program. 
  164.  
  165. PRCL: Recalls contents of an entire port to the stack. 
  166.           Argument: Port number (real) 0, 1 or 2. 
  167.           Example: 1 PRCL yields the contents of port 1 on the stack. 
  168.  
  169. àÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄù 
  170.  
  171. FIND: Searches for #LVL2+(len-1) starting at #LVL1;  -->  addr-1. 
  172.         See FNXT for automated use of FIND.  Since it isn't too useful by 
  173.         itself, FIND is "hidden" from the IO menu, but it IS in the IO 
  174.         directory, and may be used, recalled, purged, etc.  For information 
  175.         about how to hide variables from the menu, see HIDE and NULLNAME.DOC 
  176.         on the HORN1 disk.  (The HIDE program is also in the WALSH library 
  177.         on the HORN2 disk (this one)). 
  178.